#!/usr/bin/python3
# -*- coding:utf-8 -*-
# @Author    :Timo
import time

import requests


def task_up_time(func):
    def wrapper(*args, **kwargs):
        print("开始执行---------")
        now = time.time()
        result = func(*args, **kwargs)
        using = (time.time() - now) * 1000
        print(f"结束执行, 消耗时间为: {using}ms")
        return result

    return wrapper


def request_sync(url):
    response = requests.get(url)
    return response


@task_up_time
def run():
    [request_sync("https://www.baidu.com") for i in range(0, 50)]



if __name__ == '__main__':
    run()
